package com.financal.util;

import com.zhenzi.sms.ZhenziSmsClient;

import java.util.HashMap;
import java.util.Map;

public class NoteUtils {

    public String ToNote(String phone,String note){
        String result = null;
        try {
            String apiUrl = "https://sms_developer.zhenzikj.com";
            String appId = "109135";
            String appSecret = "a041981f-511e-4fba-9e16-0df65a44574a";
            ZhenziSmsClient client = new ZhenziSmsClient(apiUrl, appId, appSecret);
            Map<String, Object> params = new HashMap<String, Object>();
            //发送的手机号码
            params.put("number", phone);
            //模板ID
            params.put("templateId", "5382");
            String[] templateParams = new String[2];
            //验证码
            templateParams[0] = note;
            templateParams[1] = "5分钟";
            params.put("templateParams", templateParams);
            result =  client.send(params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

}
